<template>
	<view class="bg-white page">
		<cu-custom bgColor="bg-red" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{title}}</block>

		</cu-custom>

		<view class="cu-list menu  sm-border bg-whtie">
			<view class=" text-xs margin-top  bg-white">
				<text class="text-xs">充值金额</text>
			</view>

			<view class="cu-form-group  solid-bottom">

				<text class="text-xl">￥</text><input placeholder="" v-model="postData.money" name="input" disabled=""></input>
			</view>

			<view class="grid col-3 text-xs  padding-top-xs ">

				<view class="price-box  padding-top-xs" v-for="(item,index) in price" :key="index" @click="changePeice(item)">
					<button class="middle">{{item.price}} 元</button>
				</view>

			</view>
		</view>
		<view class=" text-xs padding-sm">
			<text class="text-sm text-red">
				
				1.为防止套现，充值金额不可提现
				2.中奖金额可全部提现

			</text>
		</view>

		<view class="padding flex flex-direction" @click="sumbit">
			<button class="cu-btn bg-red margin-tb-sm lg">确认充值</button>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "充值",
				postData:{
					money:0
				},
				price: [{
						price: 388,

					},
					{
						price: 988
					},
					{
						price: 1988
					},
					{
						price: 988
					},
					{
						price: 1988
					}


				]


			}

		},
		methods:{
			changePeice(data){
				this.postData.money=data.price;
			},
			sumbit(){
				let confirm=()=>{
					this.$Reques.request(this.$Reques.interface_url.recharge, "POST", this.postData).then((res) => {
						this.$Reques.showToast(res.message);
						if (res.status == 200) {
							
							
						}
					})
				}
				(this.postData.money!=0)?confirm():(()=>{
					
					this.$Reques.showToast("请选择充值的金额");
				})();
				
				
			}
			
			
		}




	}
</script>

<style scoped>
	
	
	.cu-list>view{
		width: 94%;
		margin-left: 3%;
	}
	.price-box>button{
		width: 94%;
		height: 70rpx;
		font-size: 24rpx;
		border: 1px solid #EEEEEE;
	
		
		background-color: white;
		
		
	
	}
</style>
